package com.eastfair.imaster.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

/**
 * <p>
 * 实体类
 * 邀约
 * </p>
 *
 * @author liuxiaobai
 * @since 2021-09-13
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("i_appointment")
@ApiModel(value = "Appointment", description = "邀约")
@AllArgsConstructor
public class Appointment extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    @TableField(value = "project_id")
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 展会ID
     */
    @ApiModelProperty(value = "展会ID")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会ID")
    private Long exhibitionId;

    /**
     * 展商ID
     */
    @ApiModelProperty(value = "展商ID")
    @TableField(value = "exhibitor_id")
    @Excel(name = "展商ID")
    private Long exhibitorId;

    /**
     * 员工userID user_account
     */
    @ApiModelProperty(value = "员工userID user_account")
    @TableField(value = "employee_user_id")
    @Excel(name = "员工userID user_account")
    private Long employeeUserId;

    /**
     * 观众userID user_account
     */
    @ApiModelProperty(value = "观众userID user_account")
    @TableField(value = "visitor_user_id")
    @Excel(name = "观众userID user_account")
    private Long visitorUserId;

    /**
     * 约见发起人身份（ACTOR、VISITOR）
     */
    @ApiModelProperty(value = "约见发起人身份（ACTOR、VISITOR）")
    @Size(max = 32, message = "约见发起人身份（ACTOR、VISITOR）长度不能超过32")
    @TableField(value = "launch_user_type", condition = LIKE)
    @Excel(name = "约见发起人身份（ACTOR、VISITOR）")
    private String launchUserType;

    /**
     * 关联数据类型(BUSINESS_CIRCLE 商脉圈)
     */
    @ApiModelProperty(value = "关联数据类型(BUSINESS_CIRCLE 商脉圈)")
    @Size(max = 32, message = "关联数据类型(BUSINESS_CIRCLE 商脉圈)长度不能超过32")
    @TableField(value = "subject_type", condition = LIKE)
    @Excel(name = "关联数据类型(BUSINESS_CIRCLE 商脉圈)")
    private String subjectType;

    /**
     * 关联数据ID
     */
    @ApiModelProperty(value = "关联数据ID")
    @TableField(value = "subject_id")
    @Excel(name = "关联数据ID")
    private Long subjectId;

    /**
     * 状态（PENDING、APPROVE、DISAPPROVE）
     */
    @ApiModelProperty(value = "状态（PENDING、APPROVE、DISAPPROVE）")
    @Size(max = 32, message = "状态（PENDING、APPROVE、DISAPPROVE）长度不能超过32")
    @TableField(value = "status", condition = LIKE)
    @Excel(name = "状态（PENDING、APPROVE、DISAPPROVE）")
    private String status;

    /**
     * 约见开始时间
     */
    @ApiModelProperty(value = "约见开始时间")
    @TableField(value = "start_time")
    @Excel(name = "约见开始时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime startTime;

    /**
     * 约见结束时间
     */
    @ApiModelProperty(value = "约见结束时间")
    @TableField(value = "end_time")
    @Excel(name = "约见结束时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime endTime;

    /**
     * 约见地点-数据字典code
     */
    @ApiModelProperty(value = "约见地点-数据字典code")
    @Size(max = 32, message = "约见地点-数据字典code长度不能超过32")
    @TableField(value = "place_code", condition = LIKE)
    @Excel(name = "约见地点-数据字典code")
    private String placeCode;

    /**
     * 主办审核状态（PENDING、APPROVE、DISAPPROVE）
     */
    @ApiModelProperty(value = "主办审核状态（PENDING、APPROVE、DISAPPROVE）")
    @Size(max = 32, message = "主办审核状态（PENDING、APPROVE、DISAPPROVE）长度不能超过32")
    @TableField(value = "sponsor_verify_status", condition = LIKE)
    @Excel(name = "主办审核状态（PENDING、APPROVE、DISAPPROVE）")
    private String sponsorVerifyStatus;

    /**
     * 留言（预留）
     */
    @ApiModelProperty(value = "留言（预留）")
    @Size(max = 255, message = "留言（预留）长度不能超过255")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "留言（预留）")
    private String remark;

    /**
     * 处理原因
     */
    @ApiModelProperty(value = "处理原因")
    @Size(max = 255, message = "处理原因长度不能超过255")
    @TableField(value = "reason", condition = LIKE)
    @Excel(name = "处理原因")
    private String reason;

    /**
     * 处理原因英文
     */
    @ApiModelProperty(value = "处理原因英文")
    @Size(max = 255, message = "处理原因英文长度不能超过255")
    @TableField(value = "en_reason", condition = LIKE)
    @Excel(name = "处理原因英文")
    private String enReason;

    /**
     * 来源（INVITE-邀约 DISTRIBUTION-管理员分配）
     */
    @ApiModelProperty(value = "来源（INVITE-邀约 DISTRIBUTION-管理员分配）")
    @Size(max = 32, message = "来源（INVITE-邀约 DISTRIBUTION-管理员分配）长度不能超过32")
    @TableField(value = "resource", condition = LIKE)
    @Excel(name = "来源（INVITE-邀约 DISTRIBUTION-管理员分配）")
    private String resource;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @TableField(value = "is_enable")
    @Excel(name = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;

    /**
     * 是否删除(默认0：未删除1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除1:已删除)")
    @TableField(value = "is_delete")
    @Excel(name = "是否删除(默认0：未删除1:已删除)")
    private Integer isDelete;


    @Builder
    public Appointment(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, Long exhibitionId, Long exhibitorId, Long employeeUserId, Long visitorUserId, 
                    String launchUserType, String subjectType, Long subjectId, String status, LocalDateTime startTime, LocalDateTime endTime, 
                    String placeCode, String sponsorVerifyStatus, String remark, String reason, String enReason, String resource, 
                    Integer isEnable, Integer isDelete) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.exhibitionId = exhibitionId;
        this.exhibitorId = exhibitorId;
        this.employeeUserId = employeeUserId;
        this.visitorUserId = visitorUserId;
        this.launchUserType = launchUserType;
        this.subjectType = subjectType;
        this.subjectId = subjectId;
        this.status = status;
        this.startTime = startTime;
        this.endTime = endTime;
        this.placeCode = placeCode;
        this.sponsorVerifyStatus = sponsorVerifyStatus;
        this.remark = remark;
        this.reason = reason;
        this.enReason = enReason;
        this.resource = resource;
        this.isEnable = isEnable;
        this.isDelete = isDelete;
    }

}
